home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / utils / crossword / includes / cwqueryreq.i < prev    next >
Encoding:
Text File  |  1980-01-04  |  6.1 KB  |  390 lines

  1.  
  2.  
  3. * This file is for the QueryReq that is required to be put up whenever
  4. * a yes/no response is required.
  5.  
  6.  
  7. * DoQueryReq(a6)
  8. * a6 = ptr to main program variables
  9.  
  10. * pop up the QueryRequester & wait for a key press.
  11.  
  12. * Requires the variables irt_tlist(L), irt_itext(L) and
  13. * irt_count(W) to be pre-set before calling. All of
  14. * these are off A6.
  15.  
  16. * assume ALL registers corrupt!
  17.  
  18.  
  19. DoQueryReq    bsr    LinkInfoText
  20.  
  21.         move.l    ThisReq(a6),a4
  22.  
  23.         move.l    mw_handle(a6),rhb_Window(a4)
  24.         move.l    mw_userport(a6),rhb_UserPort(a4)
  25.         move.l    mw_IDCMP(a6),rhb_IDCMP(a4)
  26.         lea    QueryReq(pc),a0
  27.         move.l    a0,rhb_Requester(a4)
  28.  
  29.         clr.l    rhb_PreCode(a4)
  30.  
  31.         bsr    HandleRequest
  32.  
  33.         rts
  34.  
  35.  
  36. * DoDiscQuery(a6)
  37. * a6 = ptr to main program variables
  38.  
  39. * pop up the QueryRequester for the Disc Access Panel.
  40.  
  41. * Requires the variables irt_tlist(L), irt_itext(L) and
  42. * irt_count(W) to be pre-set before calling. All of
  43. * these are off A6.
  44.  
  45. * Assume ALL registers corrupt!
  46.  
  47.  
  48. DoDiscQuery    lea    DiscWindow4(pc),a0
  49.         move.l    ms_handle(a6),d0
  50.         move.l    d0,30(a0)
  51.         CALLINT    OpenWindow
  52.         move.l    d0,dp_window3(a6)        ;got window?
  53.         beq    DDQ_Done            ;skip if not
  54.  
  55.         move.l    d0,a0
  56.         move.l    UserPort(a0),di_userport(a6)
  57.         move.l    RastPort(a0),a1
  58.         move.l    a1,di_rastport(a6)    ;now set green
  59.         moveq    #4,d0            ;background
  60.         CALLGRAF    SetRast
  61.  
  62.         bsr    LinkInfoText        ;pop in info text
  63.  
  64.         move.l    di_rastport(a6),a0
  65.         lea    IFB(pc),a1
  66.         moveq    #0,d0
  67.         move.l    d0,d1
  68.  
  69.         CALLINT    DrawBorder        ;draw the border
  70.  
  71.         move.l    irt_itext(a6),a1
  72.         move.l    di_rastport(a6),a0
  73.         moveq    #0,d0
  74.         move.l    d0,d1
  75.  
  76.         CALLINT    PrintIText        ;print the text
  77.  
  78.         lea    DQR_Select(pc),a1
  79.         move.l    dp_window3(a6),a0
  80.         sub.l    a2,a2
  81.         moveq    #0,d0
  82.         moveq    #2,d1
  83.         CALLINT    AddGList
  84.  
  85.         lea    DQR_Select(pc),a0
  86.         move.l    dp_window3(a6),a1
  87.         sub.l    a2,a2
  88.         moveq    #2,d0
  89.         CALLINT    RefreshGList
  90.  
  91.         bset    #7,applic_flag2(a6)    ;set req on flag
  92.  
  93.         addq.w    #1,ReqCount(a6)        ;1 more req active
  94.  
  95. ;        bset    #2,applic_flag2(a6)    ;set holding flag
  96.  
  97. DDQ_L1        move.l    di_userport(a6),a0    ;everything we do
  98.         lea    ehb_dp(pc),a5        ;is driven by you
  99.         bsr    DoEvent            ;(the event handler)
  100.  
  101.         tst.b    applic_flag2(a6)        ;exited requester?
  102.         bmi.s    DDQ_L1            ;back if not
  103.  
  104.         bset    #7,applic_flag2(a6)    ;set for nested call
  105.  
  106.         subq.w    #1,ReqCount(a6)        ;1 fewer req's active
  107.         bne.s    DDQ_B1        ;skip if any still active
  108.  
  109.         bclr    #7,applic_flag2(a6)    ;signal no more reqs
  110.  
  111. DDQ_B1        move.l    dp_window3(a6),a0        ;get rid of the
  112.         CALLINT    CloseWindow        ;window
  113.  
  114. DDQ_Done        rts
  115.  
  116.  
  117. * Query requester structure
  118.  
  119.  
  120. QueryReq:
  121.     dc.l    NULL
  122.     dc.w    0,20
  123.     dc.w    320,160
  124.     dc.w    0,0
  125.     dc.l    QR_Select    ;gadget ptr
  126.     dc.l    QRB        ;Border ptr
  127.     dc.l    QRT_1        ;text ptr
  128.     dc.w    NULL
  129.     dc.b    4,1
  130.     dc.l    NULL
  131.     dcb.b    32,0
  132.     dc.l    NULL
  133.     dc.l    NULL
  134.     dcb.b    36,0
  135.  
  136.  
  137. * Gadgets used by QueryReq
  138.  
  139.  
  140. QR_Image:
  141.     dc.l    QR_Select
  142.     dc.w    0,0
  143.     dc.w    1,1
  144.     dc.w    NULL
  145.     dc.w    NULL
  146.     dc.w    BOOLGADGET+REQGADGET
  147.     dc.l    NULL
  148.     dc.l    NULL
  149.     dc.l    QRT_1
  150.     dc.l    NULL
  151.     dc.l    NULL
  152.     dc.w    NULL        ;18
  153.     dc.l    DoneIG
  154.     dc.l    DoneRG        ;extra entry!
  155.  
  156.  
  157.  
  158. QR_Select:
  159.     dc.l    QR_Cancel
  160.     dc.w    10,130
  161.     dc.w    60,20
  162.     dc.w    GADGHIMAGE+GADGIMAGE
  163.     dc.w    GADGIMMEDIATE+RELVERIFY+ENDGADGET
  164.     dc.w    BOOLGADGET+REQGADGET
  165.     dc.l    SR60x20
  166.     dc.l    SS60x20
  167.     dc.l    QT_1
  168.     dc.l    NULL
  169.     dc.l    NULL
  170.     dc.w    NULL        ;18
  171.     dc.l    DoneIG
  172.     dc.l    LeaveReq        ;extra entry!
  173.  
  174. QT_1:
  175.     dc.b    9,0,RP_JAM1,0
  176.     dc.w    19,7
  177.     dc.l    NULL
  178.     dc.l    QTT_1    ;text ptr
  179.     dc.l    QT_2
  180.  
  181. QT_2:
  182.     dc.b    1,0,RP_JAM1,0
  183.     dc.w    18,6
  184.     dc.l    NULL
  185.     dc.l    QTT_1    ;text ptr
  186.     dc.l    NULL
  187.  
  188.  
  189. QTT_1:
  190.     dc.b    "Yes",0
  191.     cnop    0,2
  192.  
  193. QR_Cancel:
  194.     dc.l    NULL
  195.     dc.w    250,130
  196.     dc.w    60,20
  197.     dc.w    GADGHIMAGE+GADGIMAGE
  198.     dc.w    GADGIMMEDIATE+RELVERIFY+ENDGADGET
  199.     dc.w    BOOLGADGET+REQGADGET
  200.     dc.l    SR60x20
  201.     dc.l    SS60x20
  202.     dc.l    QT_3
  203.     dc.l    NULL
  204.     dc.l    NULL
  205.     dc.w    NULL        ;19
  206.     dc.l    DoneIG
  207.     dc.l    QuitReq        ;extra entry!
  208.  
  209. QT_3:
  210.     dc.b    9,0,RP_JAM1,0
  211.     dc.w    23,7
  212.     dc.l    NULL
  213.     dc.l    QTT_2    ;text ptr
  214.     dc.l    QT_4
  215.  
  216. QT_4:
  217.     dc.b    1,0,RP_JAM1,0
  218.     dc.w    22,6
  219.     dc.l    NULL
  220.     dc.l    QTT_2    ;text ptr
  221.     dc.l    NULL
  222.  
  223. QTT_2:
  224.     dc.b    "No",0
  225.     cnop    0,2
  226.  
  227. * Border
  228.  
  229.  
  230. QRB:
  231.     dc.w    0,0
  232.     dc.b    1,0,RP_JAM1
  233.     dc.b    5
  234.     dc.l    QRBList
  235.     dc.l    NULL
  236.  
  237. QRBList:
  238.     dc.w    0,0
  239.     dc.w    319,0
  240.     dc.w    319,159
  241.     dc.w    0,159
  242.     dc.w    0,0
  243.  
  244.  
  245. * InfoTexts IntuiText structures used by LinkInfoText()
  246.  
  247.  
  248. QRT_1:
  249.     dc.b    8,0,RP_JAM1,0
  250.     dc.w    1,1
  251.     dc.l    NULL        ;font ptr
  252.     dc.l    NULL        ;text pointer 12(An)
  253.     dc.l    NULL        ;ptr to next QRT_ 16(An)
  254.  
  255. ;QRT_2:
  256.     dc.b    1,0,RP_JAM1,0
  257.     dc.w    0,0
  258.     dc.l    NULL
  259.     dc.l    NULL        ;text pointer 12(An)
  260.     dc.l    NULL        ;ptr to next QRT_
  261.  
  262. ;QRT_3:
  263.     dc.b    8,0,RP_JAM1,0
  264.     dc.w    1,1
  265.     dc.l    NULL
  266.     dc.l    NULL        ;text pointer 12(An)
  267.     dc.l    NULL        ;ptr to next QRT_
  268.  
  269. ;QRT_4:
  270.     dc.b    1,0,RP_JAM1,0
  271.     dc.w    0,0
  272.     dc.l    NULL
  273.     dc.l    NULL        ;text pointer 12(An)
  274.     dc.l    NULL        ;ptr to next QRT_
  275.  
  276. ;QRT_3:
  277.     dc.b    8,0,RP_JAM1,0
  278.     dc.w    1,1
  279.     dc.l    NULL
  280.     dc.l    NULL        ;text pointer 12(An)
  281.     dc.l    NULL        ;ptr to next QRT_
  282.  
  283. ;QRT_4:
  284.     dc.b    1,0,RP_JAM1,0
  285.     dc.w    0,0
  286.     dc.l    NULL
  287.     dc.l    NULL        ;text pointer 12(An)
  288.     dc.l    NULL        ;ptr to next QRT_
  289.  
  290. ;QRT_3:
  291.     dc.b    8,0,RP_JAM1,0
  292.     dc.w    1,1
  293.     dc.l    NULL
  294.     dc.l    NULL        ;text pointer 12(An)
  295.     dc.l    NULL        ;ptr to next QRT_
  296.  
  297. ;QRT_4:
  298.     dc.b    1,0,RP_JAM1,0
  299.     dc.w    0,0
  300.     dc.l    NULL
  301.     dc.l    NULL        ;text pointer 12(An)
  302.     dc.l    NULL        ;ptr to next QRT_
  303.  
  304. ;QRT_3:
  305.     dc.b    8,0,RP_JAM1,0
  306.     dc.w    1,1
  307.     dc.l    NULL
  308.     dc.l    NULL        ;text pointer 12(An)
  309.     dc.l    NULL        ;ptr to next QRT_
  310.  
  311. ;QRT_4:
  312.     dc.b    1,0,RP_JAM1,0
  313.     dc.w    0,0
  314.     dc.l    NULL
  315.     dc.l    NULL        ;text pointer 12(An)
  316.     dc.l    NULL        ;ptr to next QRT_
  317.  
  318. ;QRT_3:
  319.     dc.b    8,0,RP_JAM1,0
  320.     dc.w    1,1
  321.     dc.l    NULL
  322.     dc.l    NULL        ;text pointer 12(An)
  323.     dc.l    NULL        ;ptr to next QRT_
  324.  
  325. ;QRT_4:
  326.     dc.b    1,0,RP_JAM1,0
  327.     dc.w    0,0
  328.     dc.l    NULL
  329.     dc.l    NULL        ;text pointer 12(An)
  330.     dc.l    NULL        ;ptr to next QRT_
  331.  
  332. ;QRT_3:
  333.     dc.b    8,0,RP_JAM1,0
  334.     dc.w    1,1
  335.     dc.l    NULL
  336.     dc.l    NULL        ;text pointer 12(An)
  337.     dc.l    NULL        ;ptr to next QRT_
  338.  
  339. ;QRT_4:
  340.     dc.b    1,0,RP_JAM1,0
  341.     dc.w    0,0
  342.     dc.l    NULL
  343.     dc.l    NULL        ;text pointer 12(An)
  344.     dc.l    NULL        ;ptr to next QRT_
  345.  
  346. ;QRT_3:
  347.     dc.b    8,0,RP_JAM1,0
  348.     dc.w    1,1
  349.     dc.l    NULL
  350.     dc.l    NULL        ;text pointer 12(An)
  351.     dc.l    NULL        ;ptr to next QRT_
  352.  
  353. ;QRT_4:
  354.     dc.b    1,0,RP_JAM1,0
  355.     dc.w    0,0
  356.     dc.l    NULL
  357.     dc.l    NULL        ;text pointer 12(An)
  358.     dc.l    NULL        ;ptr to next QRT_
  359.  
  360. ;QRT_3:
  361.     dc.b    8,0,RP_JAM1,0
  362.     dc.w    1,1
  363.     dc.l    NULL
  364.     dc.l    NULL        ;text pointer 12(An)
  365.     dc.l    NULL        ;ptr to next QRT_
  366.  
  367. ;QRT_4:
  368.     dc.b    1,0,RP_JAM1,0
  369.     dc.w    0,0
  370.     dc.l    NULL
  371.     dc.l    NULL        ;text pointer 12(An)
  372.     dc.l    NULL        ;ptr to next QRT_
  373.  
  374. ;QRT_3:
  375.     dc.b    8,0,RP_JAM1,0
  376.     dc.w    1,1
  377.     dc.l    NULL
  378.     dc.l    NULL        ;text pointer 12(An)
  379.     dc.l    NULL        ;ptr to next QRT_
  380.  
  381. ;QRT_4:
  382.     dc.b    1,0,RP_JAM1,0
  383.     dc.w    0,0
  384.     dc.l    NULL
  385.     dc.l    NULL        ;text pointer 12(An)
  386.     dc.l    NULL        ;ptr to next QRT_
  387.  
  388.  
  389.  
  390.